package pong.app.controllers 
{
	import common.IStateController;
	
	import pong.app.IPongAppState;
	import pong.app.IPongAppStateContext;
	/**
	 * ...
	 * @author Luke Van In
	 */
	public class PongAppStateContext implements IPongAppStateContext
	{
		
		private var _stateController:IStateController;
		
		private var _loadingState:IPongAppState;
		
		private var _menuState:IPongAppState;
		
		private var _instructionsState:IPongAppState;
		
		private var _loginState:IPongAppState;
		
		private var _playingState:IPongAppState;
		
		private var _savingState:IPongAppState;
		
		private var _scoresState:IPongAppState;
		
		
		
		public function PongAppStateContext(stateController:IStateController) 
		{
			this._stateController = stateController;
		}

		
		
		public function setLoadingState(loadingState:IPongAppState):void
		{
			this._loadingState = loadingState;
		}
		
		
		
		public function setMenuState(menuState:IPongAppState):void
		{
			this._menuState = menuState;
		}
		
		
		
		public function setInstructionsState(instructionsState:IPongAppState):void
		{
			this._instructionsState = instructionsState;
		}

		
		
		public function setLoginState(loginState:IPongAppState):void
		{
			this._loginState = loginState;
		}
		
	
		
		public function setPlayingState(playingState:IPongAppState):void
		{
			this._playingState = playingState;
		}
		
	
		
		public function setSavingState(savingState:IPongAppState):void
		{
			this._savingState = savingState;
		}
		
		
		
		public function setScoresState(scoresState:IPongAppState):void
		{
			this._scoresState = scoresState;
		}
		
		
		
		public function getCurrentState():IPongAppState
		{
			return this._stateController.getCurrentState() as IPongAppState;
		}		
		
		
		
		public function gotoLoadingState():void
		{
			this._stateController.gotoState(this._loadingState);
		}
		
		
		public function gotoMenuState():void
		{
			this._stateController.gotoState(this._menuState);
		}
		
		
		public function gotoInstructionsState():void
		{
			this._stateController.gotoState(this._instructionsState);
		}
		
		
		public function gotoLoginState():void
		{
			this._stateController.gotoState(this._loginState);
		}
		
		
		public function gotoPlayingState():void
		{
			this._stateController.gotoState(this._playingState);
		}
		
		
		public function gotoSavingState():void
		{
			this._stateController.gotoState(this._savingState);
		}
		
		
		public function gotoScoresState():void
		{
			this._stateController.gotoState(this._scoresState);
		}
		
		
		/*public function gotoState(state:IPongAppState):void 
		{
			this._stateController.gotoState(state);
		}*/
		
		
		public function isCurrentState(state:IPongAppState):Boolean 
		{
			return this._stateController.isCurrentState(state);
		}
		

	}

}